Method and apparatus for providing flow based load balancing

ABSTRACT

A method and apparatus for flow based load balancing are disclosed. For example, the present method receives at least one packet from a flow. If the flow has not being previously classified, then the flow is classified based on the characteristics of the flow. Once classified, the present method matches the flow to at least one matched path from a plurality of available paths in accordance with the characteristics of the flow and characteristics of the at least one matched path. Once matched, the present method forwards the packet from the flow to the at least one matched path for processing.

This application claims priority to French Patent Application No.06/09786 filed Nov. 9, 2006 which is incorporated herein by reference inits entirety.

The present invention relates generally to optimal utilization ofclustered resources, e.g., paths, computers, servers, networks, storagesystems, firewalls, computing services, network services, and storageservices and, in particular, to methods and apparatus for providing flowbased load balancing.

BACKGROUND OF THE INVENTION

All of today's important business and consumer applications rely oncommunications infrastructures such as the Internet. Businesses andconsumers may have multiple servers for communicating among variouslocations, for handling customer requests, transactions etc. A front-endload balancer can be used to balance the requests among the variousservers and determine which server should handle the next request.

There are a variety of load balancing methods that balance an offeredload based on network topology and routing information. For example,round robin, weighted round robin, Hypertext Transfer Protocol (HTTP)header-based, response time, Internet Protocol (IP) address hashing,Uniform Resource Locator (URL)-hashing, etc. However, these loadbalancing methods are based only on network topology and routinginformation. The real state of the network is not taken into account andall the existing paths are not made available in the routing table.Furthermore, if preference is allowed in the load balancing method, thepreferred path cannot be chosen on a per flow basis but, instead, isassigned randomly by computing the hashing. The computation of hashingdoesn't take into account the network's real state (e.g., a currentstatus) for the different paths. Thus, existing load balancing methodsimply that the route metrics on the different paths are identical andthe flows are to be distributed randomly.

Therefore, there is a need for a flow based load balancing method thatdistributes load not only in accordance with topology and routinginformation but also accounts for a current status of the various paths.

SUMMARY OF THE INVENTION

In one embodiment, the present invention discloses a method andapparatus for flow based load balancing across a plurality of resources.For example, the present method receives at least one packet from aflow. If the flow has not being previously classified, then the flow isclassified based on the characteristics of the flow. Once classified,the present method matches the flow to at least one matched path from aplurality of available paths in accordance with the characteristics ofthe flow and characteristics of the at least one matched path. Oncematched, the present method forwards the packet from the flow to the atleast one matched path for processing.

In one embodiment, classified flows are stored in a flow database andavailable paths are stored in a path database such that lookupoperations can be performed using these two databases. In oneembodiment, if the packet is not part of a classified flow, then themethod may determine whether or not the packet characteristiccorresponds to a classified similar flow. In one embodiment, thecharacteristics of the flow and/or the paths are periodically updated.

Thus, the present invention provides a load balancing method having theadvantage of distributing the load on a per flow basis in accordancewith matching the characteristics of the flow to the characteristics ofa path. As the characteristics of the flow and the characteristics ofthe assigned or selected path are changed over time, the presentinvention allows dynamic assignment of a new path for the flow.

BRIEF DESCRIPTION OF THE DRAWINGS

The teaching of the present invention can be readily understood byconsidering the following detailed description in conjunction with theaccompanying drawings, in which:

FIG. 1 illustrates an exemplary network with routers;

FIG. 2 illustrates a flowchart of a method for flow based load balancingof the present invention;

FIG. 3 illustrates an exemplary embodiment of a method for updating orcreating a path database;

FIG. 4 illustrates an exemplary embodiment of a method for updating orcreating the characteristics of a path;

FIG. 5 illustrates an exemplary embodiment of a method for selecting apath for a flow; and

FIG. 6 illustrates a high level block diagram of a general purposecomputer suitable for use in performing the functions described herein.

To facilitate understanding, identical reference numerals have beenused, where possible, to designate identical elements that are common tothe figures.

DETAILED DESCRIPTION

The present invention broadly discloses a method and apparatus for flowbased load balancing. Although the present invention is discussed belowin the context of paths or routes, the present invention is not solimited. Namely, the present invention can be applied to any cluster orset of two or more resources e.g., two or more computers or servers, twoor more storage devices or systems, two or more firewalls, two or morenetworks, two or more routers, two or more switches, two or more networkservices or two or more network devices, etc. For the purpose of scope,the term packet is intended to broadly include a record and can apply toany type of resource.

Since internet services are becoming ubiquitous, more and morebusinesses and consumers are relying on the internet for manyapplications. In r one example, a large business may have multipleservers for handling customer requests, transactions etc. In anotherexample, a business may have multiple servers for communicating amongvarious locations. A front-end load balancer may be used to balance therequests among the various servers (or communication devices) and todetermine which server (or communication device) should handle therequest based on network load.

There are a variety of load balancing methods that balance an offeredload based on network topology and routing information. For example,such methods may include round robin, Hypertext Transfer Protocol (HTTP)header-based, Internet Protocol (IP) address hashing, Uniform ResourceLocator (URL)-hashing, etc. However, these load balancing methods arebased only on network topology and routing information. In other words,the real state of the network is not taken into account and all theexisting paths are not made available in the appropriate routing table.Existing load balancing methods simply treat the different paths asidentical paths regardless of the variations in the route metrics. Thus,the flows are distributed randomly across the paths regardless of thetype of the flows. For example, a data storage application (which istypically tolerant of delay) may be sent on a path that has less delay,while another flow that is sensitive to delay is sent on a path withsignificant delay. Therefore, there is a need for a flow based loadbalancing method that distributes dynamically the load according torouting information and a current status of various available paths.

In order to better describe the invention, the following terminologieswill first be provided:

Load balancing;

Flow; and

Similar flow.

Load balancing refers to a method for distributing loads. In oneembodiment within the context of a router, load balancing refers to amethod for distributing loads via at least two different paths (e.g., aslisted on a routing table) to a destination. The process or module inthe router that performs the load balancing function is referred to as a“load balancer.” The load balancing among multiple paths can be based onstandard routing protocols such as Open Shortest Path First (OSPF),static route, etc. The multiple paths may have different distances,routing cost, etc. This is an improvement compared to current loadbalancing methods which may only use paths having the same routing cost.The load balancing may be performed per destination or per packet. Perdestination load balancing refers to the router distributing the packetsbased on the destination addresses. Per packet load balancing refers tothe router sending one packet for a specific destination over the firstpath, the second packet for the same destination over the second path,and so on.

A flow may refer to a sequence of packets having the same source anddestination addresses, common higher-level protocol types (e.g., UDP,TCP, etc.), common Type of Service (TOS), and/or common InternetProtocol (IP) precedence as indicated in the IP packet header. In oneembodiment, a flow can be classified in accordance with several criteriaand rules. For example, each criterion may be associated with acharacteristic such as throughput, class of service, jitter, delay orlatency, available bandwidth, packet loss, etc. In one embodiment,throughput refers to a measure of the amount of data transferred in aspecific amount of time. In one embodiment, class of service refers to alevel of service for a flow or a set of flows. In one embodiment,latency refers to the delay in routing packets. In one embodiment,jitter refers to a measure of the variability over time of the latencyacross a network. In one embodiment, bandwidth refers to a measure ofthe capacity of a communications channel or connection. In oneembodiment, packet loss is a measure of the number of lost packets,e.g., due to congestion. It should be noted that the present inventionis not limited to this list of criteria.

The rules may be defined by a network administrator. For example, anetwork administrator may set levels 0 to 4 for each criterion (e.g., 4being the highest level). The range of levels may be modified to matchcustomer or network administrator specifications.

In one embodiment, routers may maintain a Flow Database (FDB) thatcontains a plurality of classified flows along with the flows'characteristics. For example, a flow with 3 criteria and 5 levels mayget the following table (matrix) in the database:

Level for Level for Level for Flow criterion A criterion B criterion CFlow 1 0 2 1

A “similar flow” refers to a flow with the same destination address andsame criteria but the source addresses and protocol types can bedifferent from a referencing flow.

FIG. 1 illustrates an exemplary network 100 with routers 101 through110. Traffic from router 101 (e.g., a source router) flowing towardsrouter 110 (e.g., a destination router) may traverse over any of thearcs 120 through 135 depending on the weight of each arc. For example,traffic originating from source router 101 may flow over arcs 121, 124,130 and 135 to reach destination router 110. For clarity in thedescription below, the source router 101 will be referred to as router sand the destination router 110 will be referred to as router t.

In one embodiment, the routers utilize routing protocols to choose apath for transmitting the data. For example, routers may use the OSPFprotocol. In OSPF, an integer weight can be assigned to each arc suchthat each router in the network is made aware of the weight assignments.Each router computes a graph of shortest weight paths from itself toevery other router in the network for a given demand. Traffic can thenbe routed on the shortest weight paths. For the network above, trafficleaving router s with destination router t will traverse on the shortestpath from router s to router t. It should be noted that a router willtypically continue to forward traffic on the shortest path regardless ofcongestion levels, status, etc.

The information used by the routing protocol (OSPF) for determining theshortest path may come from the lowest three layers of the Open SystemInterconnect (OSI) protocol stack. Note that the Internet protocol andthe layer that define the packet delivery are in the third layer of theOSI stack. The upper layers of the OSI stack which constitute the layer4/5 in the network procedures are not used to build the routing table inOSPF. These upper layers define the applications such as theTransmission Control Protocol (TCP) or the User Datagram Protocol (UDP).

Recall that the routing table is updated by dynamic routing protocolssuch as OSPF, Border Gateway Protocol (BGP), etc. For each destination,the routing protocol defines at least one route. However, one aspect ofthe present invention is to define several routes in order to select themost appropriate route for a particular flow. In addition, severalprotocols may be used to generate different available routes as eachprotocol may use its own metric to build routes. For example a mix ofseveral routes provided by OSPF and BGP may be merged in the globalrouting table as well as Static routes. Once all the routes have beendetermined, a Routing Table (RT) can be generated that represents asuperset of all routing information. It should be noted that the mostappropriate route for a flow is not necessarily the best from theperspective of only considering routing weight or cost. In addition, insome instances it is possible to obtain more than one preferred routefor a destination.

In one embodiment, the load balancer maintains a Path Database (PDB)that tracks the characteristics of each of the routes listed on theRoute Table. For example, the characteristics may be premised oncriteria such as throughput, class of service, latency, packet loss,bandwidth, jitter, etc. It should be noted that these criteria are onlyexamples and the present invention is not limited only to thesecriteria. In one embodiment, the Path Database is populated by analyzingeach route on the Routing Table. For example, the criteria comprisingthroughput, class of service, latency, packet loss, bandwidth, jittercan be analyzed for the path comprising the arcs of 121, 124, 130 and135 and so on for other paths. Once the analysis is completed, thecharacteristics of each route is then stored in the Path Database.

In one embodiment, the current invention checks the path characteristicsregularly to update the database. For example, the path criteria ormetrics may be updated periodically, e.g., every 15 minutes, hourly,daily and so on.

In one embodiment, the Path Database is used for both path assignment onnew flows and reassignment of existing flows. The process of reassigningexisting flows to new paths is called “dynamic assignment.” In a dynamicassignment, a flow may use a default path first and then an analysis ofall end-to-end possible paths may follow. The process then checkswhether or not the flow should be switched to a new path. The switchingto the new path can be performed when necessary (with some delay betweenpackets at switching time to avoid sequence errors).

A path or a route is classified following similar rules used to classifya flow. Once classified, the present method may then select a path(e.g., broadly defined as a matched resource) that has the closestcharacteristics that will be best suited for a particular flow. If allcriteria of one or more paths match a flow, e.g., having the samevalues, then the first path from among the matched paths is selected. Ifno single path is a perfect match to a particular flow, then the methoddetermines which path has the characteristics that are the closest tothe flow.

In one embodiment, the present method first identifies the paths thathave a better value on all fields and then identifies the path that hasthe closest difference when compared to a particular flow. If none isfound, then a lower quality path is identified with again the lowestpossible difference when compared to a particular flow. The rules thatare used to associate a particular path with a route are defined by anetwork administrator in accordance with implementation specificrequirements. For example, the level range may be modified to match withthe network or customers specifications.

To illustrate, a matrix having a plurality of paths and a flow may beillustrated in the table 1 below:

TABLE 1 Level for Level for Level for Path criterion A criterion Bcriterion C P1 1 0 1 P2 2 1 2 P3 1 2 1 F1 1 2 1The path analysis calculates the best path, PMax, for a flow F1. In oneembodiment, for each path the method determines the difference betweenthe path and the flow while considering only the path criteria that arelower than the flow criteria. In other words, in one embodiment, it maynot be necessary to consider how well a path exceeds one or morecriteria of a flow. In contrast, the fact that a particular path failsto meet one or more criteria of a particular flow is more relevant andimportant in the path selection process. In one embodiment, thePath/Flow difference D is calculated by using basic one to onesubtraction and taking the absolute value. Using the example shown inTable 1, the difference D for Path 1 is 2; the difference D for Path 2is 1; and the difference D for Path 3 is 0. Since Path 3 has the lowestdifference D, it will be selected for flow F1.

It should be noted that although path P2 appears to have two criteriathat are superior than path P3 when compared to flow F1, path P3 isstill a better match for flow F1. The reason is that the failure of pathP2 to meet one of the criteria of flow F1 is more important than thefact that path P2 exceeds two of the criteria of flow F1. However, inone alternative embodiment, exceeding the criteria of a flow can be usedas a supplemental selection parameter.

In practice, multiple paths may have the same Path/Flow difference D fora particular flow. In such situation, the method may select one of thepaths based on other criteria, e.g., a path with the best throughput (T)for the same calculated difference D. In one embodiment, the path withthe highest throughput is preferred and then it is defined as PMax for aflow.

In one embodiment, the Flow Database (FDB) stores the definitions of theactive flows for a specific period. The information associated with theflow such as criteria, Path PMax, etc. are also stored. In oneembodiment, a statistical variable is also associated with the flows inorder to get the real throughput. The statistical variable is calculatedperiodically (for example between 1 and 5 minutes). For dynamic pathupdates of flows, the present method may also select which of the flowsshould have a path reassignment.

In one embodiment, a dual step mechanism is used to first classify therunning flows with the bandwidth real usage versus planned usage(required bandwidth at the beginning of the flow). The flows withsignificant difference between the expected and real bandwidth usage areidentified and re-entered in the classification process. In addition,for flows in progress with criteria not matching the initial flow, thestatistics is measured and a path recalculation is performed in order toconform.

When a packet of a flow arrives at the Load Balancing (LB) process, theprocess checks if the flow or a “similar flow” is already defined in theFlow DB (FDB). If it is, then the forwarding information (e.g.,information as to which path to use for forwarding the flow) is sent tothe LB process. If the flow is not defined, the Load Balancing processrequests the best paths for the flow and then sends the flow to theappropriate path. In parallel, the LB process may update the FlowDatabase (FDB) and the Forwarding Table (FWT).

In one embodiment, the Forwarding Table (FWT) contains information as tohow a flow is to be forwarded, i.e., which path or paths will be used toforward a flow. Specifically, the Forwarding Table contains a listing ofall classified flows and their current path assignments. It should benoted that although the present invention discloses the use of varioustables (e.g., routing table and forwarding table) and databases (e.g.,path database and flow database), the present invention is not solimited. Namely, additional tables can be used or various tables anddatabases can be merged.

FIG. 2 illustrates a flowchart of a method 200 for flow based loadbalancing. In one embodiment, the method 200 may have several entries asit receives and classifies incoming packets. Classifying or defining aflow comprises evaluating the characteristics of the flow, e.g.,deducing the flow's actual characteristics or simply assigning apredicted or default characteristics until actual measurement can bemade on the flow. The method also updates the flow forwardinginformation including the path to be used for a classified flow. Theupdating of flow forwarding information may be performed either at theinitial detection of a new flow, after some predefined time chosen forrefreshing the paths being used, or whenever there is a change in thenetwork that may impact the path characteristics.

Method 200 starts in step 202 and proceeds to step 205. In step 205,method 200 receives one or more packets to be analyzed and forwarded viaa flow based load balancer. The packet may belong to an existing flow orit may be the start of a new flow of packets. Method 200 proceeds tostep 210 to determine whether or not the packet has a defined flow andat least one assigned path.

In step 210, method 200 determines whether or not the packet has adefined flow in the Flow Database (FDB) and a path that exists for thedefined flow. If the received packet is part of a classified flow in theFlow Database and an associated path exists for the classified flow,then the method proceeds to step 215. Otherwise, the method proceeds tostep 220.

In step 215, method 200 looks up in the flow Forwarding Table (FWT) forthe selected path or paths that have been defined for the classifiedflow and the received packet is then forwarded in accordance with thedefined path(s). The method then proceeds back to step 205 to receivemore packets.

In step 220, method 200 determines whether or not the packetcharacteristic corresponds to a classified flow. Namely, when the packetis not associated with a defined flow in the flow database, the methodchecks to determine if the packet characteristics correspond to anotherpre-classified flow. In other words, there may be information pertainingto the received packet that will allow the method to make a predictionas to its characteristics, e.g., predicting that the flow will behave orhas requirements that are similar to another previously classified flow.One illustrative example may be that flows from the same enterprisecustomer may behave similarly. In one embodiment, a flow may becharacterized by several information fields within the IP packet. Forexample, a flow may be characterized by source/destination IP addresses,by port type such as User Datagram Protocol (UDP), Transmission ControlProtocol (TCP), etc., by protocol type such as File Transfer Protocol(FTP), Hypertext Transfer Protocol (HTTP), etc.

Thus, pre-classification refers to a short cut method that quicklydefines the flow requirements based on a single received packet becausethe flow behavior is presumed to be known based on its similarity to anexisting flow. In one example, the flow behavior may be known because itis a known customer application that requires previously definedcharacteristics for latency, bandwidth or jitter. In another example,the flow behavior may be known because the packet is using a protocolwith set static characteristics. An example is Internet Control MessageProtocol (ICMP) for which either a data path for another type of flowexists, and the mechanism forces using the same path, or no path existsand the default route is used. The reason is that ICMP used by commandssuch as “ping” are used to assess the path for other data flows and needto use the same path. Thus, no specific path needs to be defined forICMP, unless specifically defined by other pre-classification rules. Ifthe packet characteristics correspond to a classified flow, the methodproceeds to step 250. Otherwise, the method proceeds to step 225.

In step 225, method 200 analyzes and classifies the flow. Specifically,based upon information associated with the received packet, the flow isclassified. For example, a flow may be classified based on its source IPaddress, its destination IP address, its protocol and the like.

In step 230, the packet may be optionally forwarded using a defaultforwarding mode. For example, the default mode may simply use the activeIP routing table without specific forwarding rules. The method thenproceeds to step 235.

Note that at the end of step 230, the characteristics of the newlyreceived flow are not fully understood. In one embodiment, in order toassess the requirements for bandwidth, jitter, etc., the present methodallows the flow to run for a period of time. The flow's characteristics,e.g., jitter, latency, and throughput, may then be calculated afterstatistics on how packets are forwarded have been collected. Somecharacteristics such as latency may be difficult to assess accuratelyusing only a few packets, but these criteria may be initially assignedbased on rules associated with protocols. In one embodiment, the methodperforms a partial pre-classification to determine some characteristicssuch as latency. When the characteristics of the flow are not fullyunderstood, the flow is stored in the flow database along with anexpiration time to redo the classification. This re-classificationprocess will provide a more accurate characteristics profile for theflow.

In step 235, method 200 sets a flag for reclassification. For example,the Classification Flag (CF) may be set to “1” to indicate the need toperform the reclassification and to “0” otherwise. The process ofreclassification may be a full reclassification (e.g., measuring allcriteria for the flow) or it may only be a partial reclassification(e.g., measuring only a subset of all the criteria for the flow). Asmore and more volume of packets is analyzed, the classification of theflow will be better defined. The service provider or network operatordetermines the volume of packets to be analyzed for initialclassification, partial pre-classification, full classification, etc.The method then proceeds to step 240.

In step 240, method 200 enters the flow into the flow database. Namely,all the criteria associated with the newly received flow are enteredinto flow database. In one embodiment, the flow may be entered alongwith the classification flag to indicate whether a reclassification forthe flow will be necessary in the future. The method then proceeds tostep 275.

Returning to step 250, method 200 obtains path information for the flowfrom the path database. For example, if a new flow is detected and thenew flow is determined to be similar to another previously defined flow,then the path information associated with the similar flow will beobtained for the new flow. Alternatively, if step 250 is triggered foran existing flow, then it is likely that a reclassification has beenrequested. In this scenario, a plurality of available paths that can beused for the existing flow is obtained. Namely, a recalculation againsteach of the available paths will be performed.

In step 260, method 200 selects a path or updates a path selection. Thepath selection is based on matching the flow characteristics with thecharacteristics of at least one path stored in the path database. Forexample, a path/flow difference D calculation can be performed asdiscussed above. For example, if reclassification has been triggered,then statistics (e.g., measured latency, throughput rate, jitter) for aflow may now be available to better assess the characteristics of theflow. Furthermore, FIG. 5 illustrates one embodiment of a method toimplement step 260 below.

In step 265, method 200 updates the Forwarding Table (FWT).Specifically, a selected path or an updated path for the flow isrecorded in the Forwarding Table. As such, subsequent packets from forthe same flow can be properly forwarded via step 215 by looking up theassigned path in the FWT. The method then proceeds to step 270.

In step 270, method 200 updates the Path Database (PDB) to record theimpact of the flow being associated with a selected path. For example,assigning a flow to a path will impact characteristics of the selectedpath, e.g., the bandwidth or throughput of the path may be negativelyimpacted. Similarly, removing a previously classified flow from a pathwill impact characteristics of the deselected path, e.g., the bandwidthor throughput of the path may be positively impacted and so on.Consistent and timely updating of the path database will enable theprocess to react rapidly if and when there is a critical or major changein the path behavior.

In step 275, method 200 determines whether or not the flag for forcingthe reclassification is set. For the above example, the methoddetermines if the flag CF value for the flow is set to “1”. If the flagis not set to “1”, the method ends in step 299. Otherwise, the methodproceeds to step 280.

In step 280, the method sets a timer or a counter for flowreclassification. For example, the method may set a time-based orcounter-based trigger to implement partial or full re-classification.For example, the timer can be based on a predefined time period, e.g.,30 seconds, one minute and so on, or it can be based on the number ofreceived packets for a particular flow, e.g., 20 packets, 50 packets andso on.

In step 285, method 200 determines whether or not the timer has expiredor a count has been met. If the timer expired or the count has been met,then the method proceeds to step 250 to get the path information fromthe PDB. Otherwise, it continues to monitor the time or count.

It should be noted that method 200 may have multiple entry points, e.g.,method 300 as discussed below may trigger an update event. Namely, theremay be instances where there are significant changes in the network thatwill impact how flows will be assigned to different paths. For example,changes may include by not limited to, adding a new arc, adding a newrouter, upgrading the capacity of an arc, downgrading the capacity of anarc, detecting failure of a router, detecting failure of an arc,detecting maintenance work being performed on an arc or a router,detecting severe congestion, detecting a network attack, and so on.Thus, in step 245, method 200 determines whether or not an update eventis detected that may affect one or more paths stored in the PathDatabase. For example, there may be a network activity removing ordegrading the performance of some routes, etc. If an update is detected,then the method proceeds to step 265. Otherwise, the method continues tocheck for updates.

FIG. 3 illustrates an exemplary embodiment of a method 300 for updatingor creating the path database. For example, the Path Database can beupdated when new flows are assigned new paths or when network eventsoccur, e.g., failures or new deployments of arcs and so on. It should benoted that it is contemplated that the network may support a pluralityof different protocols simultaneously. As such, route updates arereceived by each routing protocol periodically and also when a networkevent occurs. In one example, there are N routing tables reflecting thedifferent routing protocols that can be used.

In step 305, method 300 receives route updates and determines the numberof routing tables N that are used. In step 310, method 300 updates thedata in routing tables in accordance with received route updates.

In step 312, the method sets n=1 as an initialization step. In step 315,method 300 is then able to retrieve the routing tables one by one.

In step 320, method 300 updates or creates a list of routes for eachdestination. Namely, the update may have altered the paths to aparticular destination, e.g., failure of an arc may reduce the number ofpaths to a destination, whereas adding a new arc or router may increasenumber of paths to a destination.

In step 325, the method then marks duplicate routes, e.g., in a commonrouting table. This step maintains the information pertaining toduplicate routes to a destination, thereby allowing the presentinvention to dynamically match the characteristics of a flow to thecharacteristics of a path due to changes in either the flow or in theassigned path. Without the knowledge of available duplicate paths, aforwarding method will not be able to quickly switch to another patheven if changes to the flow or the assigned path are detected.

In step 330, the method determines whether or not the maximum number ofrouting tables (N) is reached. If it has been reached, all routingtables have been retrieved and the method proceeds to step 340.Otherwise, the method proceeds to step 335 to update n such that thenext routing table may be retrieved. When all the routing tables havebeen retrieved, the method proceeds to step 340.

In step 340, method 300 determines whether or not the path database isempty. If the database is not empty, the method proceeds to step 345 toinsert the new routes into the path database. Otherwise, the methodproceeds to step 350 to insert all routes including the duplicate routes(as marked in step 325) in the path database. The method then proceedsto step 360.

In step 360, once all routes or paths have been identified, one or moreof paths' characteristics can be measured or updated in the pathdatabase.

FIG. 4 illustrates an exemplary method 400 (e.g., as deployed in step360 of FIG. 3) for creating or updating the characteristics of thepaths. For example, for each route entry in the Path Database, themethod will define or update the characteristics associated with thepath such as latency, jitter, packet loss, throughput, bandwidth, etc.

In step 405, method 400 places all new or updated routes in a queue toget characteristic updates. Each route has at least the followingattributes: SRC (source), DEST (destination), Timestamp, protocol andmetric. The method then proceeds to step 420.

In step 420, method 400 determines whether or not there is a routewaiting in a queue for characteristics update. If the queue is empty,the method proceeds to step 425. Otherwise, the method proceeds to step435.

In step 425, method 400 resets the index to indicate the fact that thequeue is empty. The method then proceeds to step 430 to start the timerfor checking the queue. The method then proceeds to step 432 todetermine whether or not the timer expired. When the time expires, themethod proceeds back to step 420 to re-check the queue, and so on.

In step 435, method 400 obtains route characteristics. For example, arequest may be sent to a global server which manages a databasecontaining all these statistics, e.g., latency measurements, packet lossdata, throughput data and so on. In one embodiment, the global servermay be designed for performing the reporting functions and may have thevalues available and stored locally. In an alternative embodiment, if acentralized reporting tool is not made available, then the server mayneed to poll individually the devices in each of the paths todynamically acquire the values for the path characteristics.

The method then proceeds to step 440 and calculates the new route orpath characteristics. The method then updates the path database with thenewly updated characteristics in step 445. The updating index is thenincremented in step 450 such that the next route in queue can beretrieved. The method then proceeds back to step 420 to determinewhether or not there are more routes in the queue waiting forcharacteristic updates.

FIG. 5 illustrates an exemplary method 500 (e.g., as deployed in step260 of FIG. 3) for selecting a path for a flow. The Path Database (PDB)contains the path information such as a list of paths and theircharacteristics. The selection of a path may be triggered by a number ofdifferent scenarios, e.g., detecting changes in a path that is currentlyin use for a classified flow, detecting changes in characteristics of aclassified flow, detecting a new flow, etc. For example, themodification of one the following parameters in a path: route change,delay, bandwidth or cost update may generate an alert. Based on thisalert, flows that are supported by the affected path may need to beevaluated to determine whether the changes to the characteristics of theaffected path will warrant new path assignments.

In step 505, method 500 receives an alert for update(s) of a path,characteristic of a path, etc. that may affect path selection for flows.The method then proceeds to step 510 and creates a list of flows thatmay be impacted based on the alert. For example, the method determinesthe number of flows N, and assigns flow numbers sequentially (e.g. 1, 2,3, . . . , N).

In step 515, the index for selecting a path for a flow is initialized.For example, the index “n” is set to one to begin the selection of apath for the first flow. In step 520, method 500 selects one flow forselecting a path. For example, flow number “n” may be selected.

In step 525, method 500 updates the path for the selected flow (e.g.,flow number “n”). For example, this step may execute the recomputationof the path/flow difference D for the flow against all available paths.Since the characteristics of the assigned path may have changed, it ispossible that an alternate path will now be better suited to thecharacteristics of the flow.

In step 530, method 500 determines whether or not n=N, i.e., whether thelast flow is reached. If the maximum number of flows “N” is notachieved, then the index n is incremented by one in step 535 by setting“n=n+1.” The method then proceeds back to step 520 to select the nextflow.

It should be noted that as new path assignments are made, it is possiblethat the list of impacted flows may continue to grow. For example, if apath, e.g., P1, has failed, then it is likely that flows supported bythe failed path P1 will be reassigned to other paths, e.g., P2 and P3.However, such reassignments may impact the characteristics of the pathsP2 and P3, thereby triggering reclassification of flows that arecurrently being supported by the paths P2 and P3. This potentially maycreate a cascading effect. As such, in one embodiment, the method maylock the flow list to avoid new inputs if a cascading effect isdetected. For example, during major system outages, it may be necessaryto deal with updates for failed paths due to the outages prior tohandling individual path changes for marginal improvements.

In step 540, method 500 clears the list of flows to remove processedflows. For example, when paths are assigned to all N flows in the list,then the list is cleared. New entries may then start from 1 when newalerts are received in step 505. Method 500 then proceeds to step 505 toreceive new alerts or to step 560 to end the current process ofselecting paths for flows.

FIG. 6 depicts a high level block diagram of a general purpose computersuitable for use in performing the functions described herein. Asdepicted in FIG. 6, the system 600 comprises a processor element 602(e.g., a CPU), a memory 604, e.g., random access memory (RAM) and/orread only memory (ROM), a flow based load balancer module 605, andvarious input/output devices 606 (e.g., network interface cards, such as10, 100, or Gigabit Ethernet NIC cards, Fibre Channel Host Bus Adapters,Infiniband adapters, storage devices, including but not limited to, atape drive, a floppy drive, a hard disk drive or a compact disk drive, areceiver, a transmitter, a speaker, a display, a speech synthesizer, anoutput port, and a user input device (such as a keyboard, a keypad, amouse, and the like)).

It should be noted that the present invention can be implemented insoftware and/or in a combination of software and hardware, or entirelyin hardware, e.g., using application specific integrated circuits(ASIC), a general purpose computer or any other hardware equivalents. Inone embodiment, the present flow based load balancer module or process605 can be loaded into memory 604 and executed by processor 602 toimplement the functions as discussed above. As such, the present flowbased load balancer method 605 (including associated data structures) ofthe present invention can be stored on a computer readable medium orcarrier, e.g., RAM memory, magnetic or optical drive or diskette and thelike.

While various embodiments have been described above, it should beunderstood that they have been presented by way of example only, and notlimitation. Thus, the breadth and scope of a preferred embodiment shouldnot be limited by any of the above-described exemplary embodiments, butshould be defined only in accordance with the following claims and theirequivalents.

What is claimed is:
 1. A method for processing a flow of packets,comprising: receiving, via a processor, a packet from the flow;classifying, via the processor, the flow based on characteristics of theflow; matching, via the processor, the flow to a matched resource from aplurality of presently available resources in accordance with thecharacteristics of the flow and characteristics of the matched resource,wherein the characteristics of the flow and the characteristics of thematched resource comprise a throughput, wherein the characteristics ofthe flow and the matched resource further comprise a packet lossparameter, wherein the matched resource comprises a path, wherein thematching comprises computing a difference between the characteristics ofthe flow and characteristics of each of a plurality of available paths,where the path is selected based on a lowest difference, wherein thedifference between the characteristics of the flow and characteristicsof each of a plurality of available paths only accounts for pathcriteria that are lower than flow criteria; and forwarding, via theprocessor, the packet from the flow to the matched resource forprocessing.
 2. The method of claim 1, wherein the matched resourcefurther comprises a network device.
 3. The method of claim 1, whereinthe classifying of the flow is performed periodically.
 4. The method ofclaim 1, further comprising: updating the characteristics of the matchedresource periodically.
 5. The method of claim 1, further comprising:updating the characteristics of the matched resource in response to anetwork update.
 6. The method of claim 1, further comprising: matchingthe flow dynamically to another matched resource if the characteristicsof the flow and characteristics of the another matched resource is abetter match when compared to characteristics of the matched resource.7. A non-transitory computer-readable medium storing a plurality ofinstructions which, when executed by a processor, cause the processor toperform operations for processing a flow of packets, the operationscomprising: receiving a packet from the flow; classifying the flow basedon characteristics of the flow; matching the flow to a matched resourcefrom a plurality of presently available resources in accordance with thecharacteristics of the flow and characteristics of the matched resource,wherein the characteristics of the flow and the characteristics of thematched resource comprise a throughput, wherein the characteristics ofthe flow and the matched resource further comprise a packet lossparameter, wherein the matched resource comprises a path, wherein thematching comprises computing a difference between the characteristics ofthe flow and characteristics of each of a plurality of available paths,where the path is selected based on a lowest difference, wherein thedifference between the characteristics of the flow and characteristicsof each of a plurality of available paths only accounts for pathcriteria that are lower than flow criteria; and forwarding the packetfrom the flow to the matched resource for processing.
 8. Thenon-transitory computer-readable medium of claim 7, wherein the matchedresource further comprises a network device.
 9. The non-transitorycomputer-readable medium of claim 7, wherein the classifying of the flowis performed periodically.
 10. The non-transitory computer-readablemedium of claim 7, further comprising: updating the characteristics ofthe matched resource periodically.
 11. The non-transitorycomputer-readable medium of claim 7, further comprising: matching theflow dynamically to another matched resource if the characteristics ofthe flow and characteristics of the another matched resource is a bettermatch when compared to characteristics of the matched resource.
 12. Anapparatus for processing a flow of packets comprising: a processor; anda computer-readable medium storing a plurality of instructions which,when executed by the processor, cause the processor to performoperations, the operations comprising: receiving a packet from the flow;classifying the flow based on characteristics of the flow; matching theflow to a matched resource from a plurality of presently availableresources in accordance with the characteristics of the flow andcharacteristics of the matched resource, wherein the characteristics ofthe flow and the characteristics of the matched resource comprise athroughput, wherein the characteristics of the flow and the matchedresource further comprise a packet loss parameter, wherein the matchedresource comprises a path, wherein the matching comprises computing adifference between the characteristics of the flow and characteristicsof each of a plurality of available paths, where the path is selectedbased on a lowest difference, wherein the difference between thecharacteristics of the flow and characteristics of each of a pluralityof available paths only accounts for path criteria that are lower thanflow criteria; and forwarding the packet from the flow to the matchedresource for processing.